﻿using log4net;
using OA.UI.MVC.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
using System.Web.Mvc;
using static System.Net.Mime.MediaTypeNames;

namespace OA.UI.MVC.Controllers
{
    public class TestController : Controller
    {
        // [MyActionFilter]

        private static ILog logger = LogManager.GetLogger(typeof(TestController));

        [AllowAnonymous]
        public ActionResult Index()
        {
            throw new Exception("一个未知异常！");
            //logger.Info("使用log4net记录了一个信息");
            //logger.Error("记录了一个错误！");
            return Content("这是放的执行结果！");
        }

        [AllowAnonymous]
        [OutputCache(Duration =60,VaryByParam ="id")]
        public ActionResult Index1(int id)
        {
            ViewBag.Time = DateTime.Now.ToString();
            return View();
        }
    }
}